**********************************************************************
*Master analysis file (MEDICARE DATA)
*Run on NBER server
**********************************************************************

	*I. PREPARE REGRESSION INPUTS
	*Data prep: This file assumes the construction of episode files from 
	*Traditional Medicare.
	*The code below constructs the inputs files to all regressions, Tables, and 
	*Figures using Medicare data.

	*0. Define non-deferrable conditions
	do "0_prog_master_vfinal.do"
	
	*1. Create regression files 
	*Select analysis sample (Elevance hospitals, non-deferrable conditions)
	*Generate risk histories, readmissions, and mortality variables
	do "1_build_inpatient_sample_vfinal.do"

	
**********************************************************************
	*II. ANALYSIS 
	*The below files construct the Tables and Figures that use Medicare data.
	
	*2. Main regressions
	do "2_mort_reg_vfinal.do" 
	*Table 6(b); Table A3(d) 
	*Figures 7(d,e)
	
	*3. Create summary statistics files 
	do "3_build_descriptive_sample_vfinal.do" 
	
	*4. Summary stats
	do "4_desc_summ_vfinal.do" 
	*Table 1(d)